const viewGenerator = require('./plop-templates/view/prompt')
const componentGenerator = require('./plop-templates/component/prompt')
const storeGenerator = require('./plop-templates/store/prompt.js')


const optionsGenerator = require('./plop-templates/options/prompt.js')
const {notEmpty} = require("./plop-templates/utils");

module.exports = function (plop) {
  plop.setGenerator('view', {
    description: 'generate a view',
    prompts: [
      {
        type: 'input',
        name: 'name',
        message: 'view name please'
      }
    ],
    actions: [
      {
        type: 'add',
        path: `./src/views/{{name}}/{{name}}.vue`,
        templateFile: 'plop-templates/view/index.hbs',
      },
      {
        type: 'add',
        path: `./src/views/{{name}}/{{name}}-options.js`,
        templateFile: 'plop-templates/options/index.hbs',
      },
      {
        type: 'add',
        path: `./src/views/{{name}}/{{name}}.js`,
        templateFile: 'plop-templates/api/index.hbs',
      }
    ]
  })
  // plop.setGenerator('options', optionsGenerator)
  // plop.setGenerator('component', componentGenerator)
  // plop.setGenerator('store', storeGenerator)
}
